package com.glory.dgcpcpda.adapter;

import android.graphics.Color;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.dgcpcpda.R;
import com.glory.dgcpcpda.entity.EdcEntity;
import com.glory.dgcpcpda.entity.EdcSetBinEntity;

import java.util.List;

/**
 * FileName: LastBatchAdapter
 * Author: XJH
 * Date: 2020/11/28 0:44
 * Description:
 * History:
 */
public class LastBatchAdapter extends BaseQuickAdapter<EdcEntity.EdcSet, BaseViewHolder> {
    public LastBatchAdapter( @Nullable List<EdcEntity.EdcSet> data) {
        super(R.layout.adapter_edc_bin, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, EdcEntity.EdcSet item) {
        helper.setText(R.id.tvName,item.getLOTID())
                .setText(R.id.tvDesc,item.getMAINQTY())
                .setGone(R.id.etComment,false)
                .setGone(R.id.etValue,false);

        if (item.getSUBQTY() == 1){
            helper.setBackgroundColor(R.id.llItemLayout,Color.rgb(135,153,163));
        }else {
            helper.setBackgroundColor(R.id.llItemLayout,Color.WHITE);
        }
    }
}
